#include "composite.h"
#include <iostream>

using namespace composite;

void Menu::Add(MenuComponent* m)
{
    this->m_menus.push_back(m);
}

void Menu::MenuPrint()
{
    std::cout << this->m_name << std::endl;
    std::cout << this->m_descri << std::endl;
    std::cout << "------------------------------" << std::endl;
    std::vector<MenuComponent*>::iterator it = this->m_menus.begin();
    for (; it != this->m_menus.end(); ++it)
    {
        (*it)->MenuPrint();
    }
}

void MenuItem::MenuPrint()
{
    std::cout << this->m_name << std::endl;
    if (this->m_bvegetarian)
    {
        std::cout << "(v)" << std::endl;
    }
    std::cout << this->m_price << std::endl;
    std::cout << this->m_descri << std::endl;
}

void Waitress::PrintMenu()
{
    this->m_allmenus->MenuPrint();
}
